<template>
  <div id="home" class="component-wrap">
    <mt-tabbar v-model="bottomBarActive" fixed>
      <mt-tab-item id="container1"><div slot="icon" class="bottom-bar1-icon"></div>资产</mt-tab-item>
      <mt-tab-item id="container2"><div slot="icon" class="bottom-bar2-icon"></div>我的</mt-tab-item>
    </mt-tabbar>
    <mt-tab-container v-model="bottomBarActive" swipeable>
      <mt-tab-container-item id="container1">
        <div class="container1-content">
          <img src="../assets/bg_home@3x.png" class="container1-bg"/>
          <h2 class="h">聚好联资产管理系统</h2>
          <h3>总资产</h3>
          <p class="asset-value">2468</p>
          <ul class="asset-items">
            <li>
              <p class="asset-items-name">使用中资产</p>
              <p class="asset-items-val">1060</p>
            </li>
            <li>
              <p class="asset-items-name">未盘点资产</p>
              <p class="asset-items-val">1060</p>
            </li>
            <li>
              <p class="asset-items-name">本月新增</p>
              <p class="asset-items-val">1060</p>
            </li>
          </ul>
          <div class="management-nav shadow">
            <h4>资产管理</h4>
            <ul class="management-nav-items clearfix">
              <li @click="goTab('/home/asset/assetManagement')">
                <img src="../assets/ic_home_asset@3x.png" />
                <p>资产管理</p>
              </li>
              <li @click="goTab('/home/check/checkManagement')">
                <img src="../assets/ic_home_check@3x.png" />
                <p>盘点管理</p>
              </li>
              <li @click="goTab('/home/repair/assetRepair')">
                <img src="../assets/ic_home_repair@3x.png" />
                <p>维修管理</p>
              </li>
              <li @click="goTab('/home/allocate/allocateManagement')">
                <img src="../assets/ic_home_transfer@3x.png" />
                <p>调拨管理</p>
              </li>
              <li @click="goTab('/home/handle/handleManagement')">
                <img src="../assets/ic_home_dispose@3x.png" />
                <p>处置管理</p>
              </li>
              <li @click="goTab('/home/warn/warnManagement')">
                <img src="../assets/ic_home_alarm@3x.png" />
                <p>告警管理</p>
              </li>
            </ul>
          </div>
        </div>
      </mt-tab-container-item>
      <mt-tab-container-item id="container2">
        <div class="container2-content">
          <h2 class="h">我的</h2>
          <div class="personal clearfix">
            <div class="personal-avator"></div>
            <div class="personal-info">
              <p class="personal-time">20190129-13</p>
              <p class="personal-name">Jacky李勇蓝</p>
            </div>
          </div>
          <div class="personal-item">
            <div class="personal-content line clearfix">
              <span>修改登录密码</span>
              <img src="../assets/arrow_right@3x.png" />
            </div>
          </div>
          <div class="personal-item">
            <div class="personal-content clearfix">
              <span>修改绑定手机</span>
              <img src="../assets/arrow_right@3x.png" />
            </div>
          </div>
          <div class="personal-item logout" @click="logout">注销登录</div>
        </div>
      </mt-tab-container-item>
    </mt-tab-container>
  </div>
</template>

<script type="text/ecmascript-6">
  import { Tabbar, TabItem, TabContainer, TabContainerItem } from 'mint-ui';

  export default {
    name: "Home",
    data:function(){
      return {
        bottomBarActive: "container1"
      }
    },
    methods: {
      goTab:function(val){
        this.$router.push(val)
      },
      logout:function(){
        this.$router.push({ path: '/login' })
      }
    }
  }
</script>

<style scoped>
  #home .mint-tabbar {
    height: 5rem;
  }
  #home .mint-tab-item-label {
    font-size: 1rem;
    color: #656565;
  }
  #home .mint-tabbar > .mint-tab-item.is-selected {
    color: #0CC;
    background: #fff;
  }
  #home .bottom-bar1-icon {
    background: url("../assets/ic_tab_asset_normal@3x.png") no-repeat;
    -webkit-background-size: 100% 100%;
    -moz-background-size: 100% 100%;
    -ms-background-size: 100% 100%;
    -o-background-size: 100% 100%;
    background-size: 100% 100%;
  }
  #home .bottom-bar2-icon {
    background: url("../assets/ic_tab_user_normal@3x.png") no-repeat;
    -webkit-background-size: 100% 100%;
    -moz-background-size: 100% 100%;
    -ms-background-size: 100% 100%;
    -o-background-size: 100% 100%;
    background-size: 100% 100%;
  }
  #home .mint-tabbar > .mint-tab-item.is-selected .bottom-bar1-icon{
    background: url("../assets/ic_tab_asset_focus@3x.png") no-repeat;
    -webkit-background-size: 100% 100%;
    -moz-background-size: 100% 100%;
    -ms-background-size: 100% 100%;
    -o-background-size: 100% 100%;
    background-size: 100% 100%;
  }
  #home .mint-tabbar > .mint-tab-item.is-selected .bottom-bar2-icon{
    background: url("../assets/ic_tab_user_focus@3x.png") no-repeat;
    -webkit-background-size: 100% 100%;
    -moz-background-size: 100% 100%;
    -ms-background-size: 100% 100%;
    -o-background-size: 100% 100%;
    background-size: 100% 100%;
  }
  #home .mint-tab-item {
    padding: 0.1rem 0;
  }
  #home .mint-tab-item-icon {
    width: 2.4rem;
    height: 2.4rem;
    margin: 0 auto;
  }
  #home .container1-content {
    position: relative;
    width: 100%;
    padding-bottom: 1rem;
  }
  #home .container1-content .container1-bg{
    display: block;
    width: 100%;
    height: 49rem;
  }
  #home .container1-content h2 {
    position: absolute;
    top: 1.3rem;
    left: 0;
    margin: 0;
  }
  #home .container1-content h3 {
    position: absolute;
    top: 6rem;
    left: 0;
    width: 100%;
    text-align: center;
    color: #FFFFFF;
    font-size: 1.4rem;
    letter-spacing: 0.1rem;
    font-weight: normal;
  }
  #home .container1-content .asset-value {
    position: absolute;
    top: 9rem;
    left: 0;
    width: 100%;
    text-align: center;
    color: #FFFFFF;
    font-size: 4.8rem;
    letter-spacing: 0.2rem;
  }
  #home .container1-content .asset-items {
    display: flex;
    position: absolute;
    top: 17.5rem;
    left: 0;
    width: 100%;
  }
  #home .container1-content .asset-items li {
    flex: 1;
    text-align: center;
    font-size: 1.4rem;
    color: #FFFFFF;
  }
  #home .container1-content .asset-items li .asset-items-name {
    letter-spacing: 0.1rem;
    opacity: 0.6;
    filter: alpha(opacity=60);
  }
  #home .container1-content .asset-items li .asset-items-val {
    font-size: 2.2rem;
    margin-top: 0.5rem;
  }
  #home .container1-content .management-nav {
    position: absolute;
    top: 24rem;
    left: 50%;
    margin-left: -46%;
    width: 92%;
    padding: 1.4rem 0;
    background: #fff;
  }
  #home .management-nav h4 {
    font-size: 1.5rem;
    color: #171717;
    padding-left: 1.6rem;
    margin-bottom: 1.5rem;
  }
  #home .management-nav .management-nav-items {
    width: 100%;
    overflow: hidden;
  }
  #home .management-nav .management-nav-items li {
    float: left;
    width: 25%;
    text-align: center;
    margin-top: 1.4rem;
  }
  #home .management-nav-items li img {
    display: block;
    width: 5.2rem;
    height: 5.2rem;
    margin: 0 auto;
  }
  #home .management-nav-items li p {
    width: 100%;
    font-size: 1.4rem;
    color: #4A4A4A;
    line-height: 3rem;
  }
  #home .container2-content {
    width: 100%;
    height: 100%;
    background: url("../assets/bg_user@3x.png") no-repeat top center;
    -webkit-background-size: 100% auto;
    -ms-background-size: 100% auto;
    -moz-background-size: 100% auto;
    -o-background-size: 100% auto;
    background-size: 100% auto;
    overflow: hidden;
  }
  #home .container2-content .personal {
    width: 100%;
    margin: 3.6rem auto 2.2rem;
  }
  #home .personal .personal-avator {
    float: left;
    width: 7.2rem;
    height: 7.2rem;
    background: url("../assets/pic_user@3x.png") no-repeat;
    -webkit-background-size: 100% 100%;
    -moz-background-size: 100% 100%;
    -ms-background-size: 100% 100%;
    -o-background-size: 100% 100%;
    background-size: 100% 100%;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    border-radius: 50%;
    margin: 0 1.6rem;
  }
  #home .personal .personal-info {
    float: left;
  }
  #home .personal .personal-time {
    margin-top: 1rem;
    font-size: 1.8rem;
    color: #FFFFFF;
    font-weight: bold;
  }
  #home .personal .personal-name {
    margin-top: 0.5rem;
    font-size: 1.2rem;
    color: #FFFFFF;
    color: rgba(255, 255, 255, 0.7)
  }
  #home .personal-item {
    width: 100%;
    height: 6.5rem;
    background: #fff;
  }
  #home .personal-item .personal-content {
    width: 92%;
    height: 6.5rem;
    line-height: 6.5rem;
    margin: 0 auto;
    font-size: 1.5rem;
    color: #4A4A4A;
  }
  #home .personal-item .personal-content span {
    float: left;
  }
  #home .personal-item .personal-content img {
    float: right;
    width: 2rem;
    height: 2rem;
    margin-top: 2.2rem;
  }
  #home .logout {
    margin-top: 1.5rem;
    text-align: center;
    line-height: 6.5rem;
    font-size: 1.5rem;
    color: #FF5050;
    letter-spacing: 0.1rem;
  }
  #home .line {
    border-bottom: 1px solid #EEEEEE;
  }
</style>
